<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}

			#wrap {
				width: 400px;
				height: 400px;
				background: pink;
				position: relative;
			}
			/* 已知高宽的元素水平居中方案 */
			#inner{
				position: absolute;
				left: 50%;
				top: 50%;
				width: 100px;
				height: 100px;
				margin-left: -50px;
				margin-top: -50px;
				background: deeppink;
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<div id="inner">
				test
			</div>
		</div>
	</body>
</html>
